<?php
/**
 * Created by PhpStorm.
 * User: Wang YuLong
 * Date: 2018/11/7
 * Time: 17:05
 */
namespace app\index\model;

use think\Model;

class Manage extends Model
{
    protected $resultSetType = 'collection';

    //查询未操作信息
    public function isstatus(){
        $res=$this->where('status',1)->select();
        return $res;
    }
    //同意审核
    public function add($id){
        $res=$this->where('id',$id)->update(['status'=>2]);
        $userid=$this->where('id',$id)->find();
        zsgc("同意了【".$userid['name']."】的团长审核");
        $user=new User();
        $arr=$user->ismanage($userid['userid']);
        return $res;
    }
    //驳回审核
    public function del($id){
        $res=$this->where('id',$id)->update(['status'=>0]);
        $data=$this->where('id',$id)->find();
        zsgc("驳回了【".$data['name']."】的团长审核");
        return $res;
    }
    //计算审核数量
    public function number(){
        $res=$this->where('status',1)->field('count(id) as count')->find();
        echo $res['count'];
    }
}